package com.day0914;

public class Text2 {

    public boolean myEquals(int nums1[],int nums2[]){
        if(nums1.length != nums2.length){
            return false;
        }
        for (int i = 0; i < nums1.length; i ++){
            if(nums1[i] != nums2[i]){
                return false;
            }
        }
        return true;
    }
    public void myFill(int[] nums,int val){
        for (int i = 0; i < nums.length; i ++){
            nums[i] = val;
        }
    }
    public void mySort(int[] arrint){
        for (int i = 0; i < arrint.length - 1; i ++){
            for (int j = 0; j < arrint.length - 1 - i; j ++){
                if (arrint[j] > arrint[j + 1]){
                    int temp = arrint[j];
                    arrint[j] = arrint[j + 1];
                    arrint[j + 1] = temp;
                }
            }
        }

    }
    /**查找数组下标
     *@param：arrint
     * @return
     */

    public int myBinArySearch(int[] arrint,int val){
        for (int i = 0; i < arrint.length; i ++){
            if (val == arrint[i]){
                return i;
            }
        }
        return -1;
    }
}
